<!-- !Main -->
<div id="main" class="sidebar-right"><!-- class="sidebar-none", class="sidebar-left", class="sidebar-right" -->

    <div class="wf-wrap">
        <div class="wf-container-main">

            <div id="content" role="main" class="content">

                <article class="post">

                    <h1 class="entry-title">Đơn hàng: <?php echo $model->code; ?></h1>
                    <div class="hr-breadcrumbs divider-heder">
                        <div class="assistive-text">You are here:</div>
                        <ol class="breadcrumbs wf-td text-small flat">
                            <li><a href="<?php echo $this->baseUrl?>">Home</a></li>
                            <li><a href="<?php echo $this->createUrl('/web/customer/bills')?>">Danh sách đơn hàng</a></li>
                        </ol>
                    </div>
                    <div class="wf-container">
                        <div class="wf-cell wf-2-2">

                            <?php $this->widget('web.components.widgets.AlertWidget');?>

                            <blockquote class="shortcode-blockquote block-style-widget">
                                <em>
                                    <?php if(in_array($model->status, array('CANCEL', 'COMPLETED'))):?>
                                        <?php if($model->status == 'COMPLETED'):?>
                                            Đơn hàng <?php echo $model->code?> đã hoàn thành
                                        <?php else:?>
                                            Đơn hàng <?php echo $model->code?> đã bị hủy bỏ
                                        <?php endif?>  
                                    <?php else:?>
                                        Xem đơn hàng <?php echo $model->code?>  
                                    <?php endif?>
                                </em>
                            </blockquote>
                        </div>
                    </div>
                    
                    <div class="gap-10"></div>
                    <div class="hr-thin"></div>
                    <div class="gap-10"></div>

                    <div class="block" style="text-decoration: underline;">
                        <i class="icon-share"></i> <b>Thông tin đơn hàng: <?php echo $model->code; ?></b>
                    </div>
                    <br>

                    <?php echo $this->renderPartial('_view_content',array('model'=>$model, 'info'=>$info)); ?>

                    <?php if($this->manager && $this->manager->isAdmin):?>
                    <div class="gap-10"></div>
                    <div class="hr-thick"></div>
                    <div class="gap-10"></div>
                        <div class="block" style="text-decoration: underline;">
                            <b>Update Logs</b>
                        </div>

                        <table class="table table-bordered table-striped table-hover">
                            <thead>
                                <tr>
                                    <th>Thời gian</th>
                                    <th>Trạng thái thanh toán</th>
                                    <th>Trạng thái giặt</th>
                                    <th>Trạng thái trả đồ</th>
                                    <th>Trạng thái đơn hàng</th>
                                    <th>Người thay đổi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach($model->managerUpdateBills as $mub):?>
                                    <tr>
                                        <td><?php echo $mub->createdTime?></td>
                                        <td>
                                            <span class="label bg-<?php echo Bill::model()->getLabelStyle($mub->status_pay)?>">
                                                <?php echo Bill::model()->getStatusPayLabel($mub->status_pay)?>
                                            </span>
                                        </td>
                                        <td>
                                            <span class="label bg-<?php echo Bill::model()->getLabelStyle($mub->status_do)?>">
                                                <?php echo Bill::model()->getStatusDoLabel($mub->status_do)?>
                                            </span>
                                        </td>
                                        <td>
                                            <span class="label bg-<?php echo Bill::model()->getLabelStyle($mub->status_return)?>">
                                                <?php echo Bill::model()->getStatusReturnLabel($mub->status_return)?>
                                            </span>
                                        </td>
                                        <td>
                                            <span class="label bg-<?php echo Bill::model()->getLabelStyle($mub->status)?>">
                                                <?php echo Bill::model()->getStatusLabel($mub->status)?>
                                            </span>
                                        </td>
                                        <td><?php echo $mub->manager->name?> (<?php echo $mub->manager->phone?>)</td>
                                    </tr>
                                    <?php endforeach?>
                            </tbody>
                        </table>
                        <?php endif?>


                    <div class="gap-10"></div>
                    <div class="hr-thin"></div>
                    <div class="gap-10"></div>



                </article><!-- .post -->


            </div><!-- #content -->


            <?php $this->renderPartial('//common/sidebar');?>

        </div><!-- .wf-container -->
    </div><!-- .wf-wrap -->
</div><!-- #main -->